import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '../layout/index.vue'

Vue.use(VueRouter)

const routes = [{
		path: '/',
		component: Layout,
		redirect: '/home',
		hidden: true,
		children: [{
			path: "/home",
			name: 'Home',
			component: () => import('../views/home')
		}]
	},
	{
		path: '/patientManage',
		name: 'PatientManage',
		component: Layout,
		meta: {
			title: '患者管理',
			icon: 'el-icon-first-aid-kit'
		},
		children: [{
				path: "hospitalization",
				name: 'Hospitalization',
				component: () => import('../views/hospitalization'),
				meta: {
					title: '住院患者',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "hospital",
				name: 'Hospital',
				component: () => import('../views/hospital'),
				meta: {
					title: '本院非住院患者',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "department",
				name: 'Department',
				component: () => import('../views/department'),
				meta: {
					title: '科室历史患者',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "patientDetail",
				name: 'PatientDetail',
				component: () => import('../views/patientDetail'),
				hidden: true,
				meta: {
					title: '患者详情',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "addPatient",
				name: 'AddPatient',
				component: () => import('../views/addPatient'),
				hidden: true,
				meta: {
					title: '添加患者',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "editPatient",
				name: 'EditPatient',
				component: () => import('../views/editPatient'),
				hidden: true,
				meta: {
					title: '编辑患者',
					icon: 'el-icon-first-aid-kit'
				}
			}
		]
	},
	{
		path: '/hospitalManagement',
		component: Layout,
		name: 'HospitalManagement',
		meta: {
			title: '医院管理',
			icon: 'el-icon-first-aid-kit'
		},
		children: [{
				path: "accountManagement",
				name: 'AccountManagement',
				component: () => import('../views/accountManagement'),
				meta: {
					title: '账号管理',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "addAccount",
				name: 'AddAccount',
				component: () => import('../views/addAccount'),
				hidden:true,
				meta: {
					title: '添加账号',
					icon: 'el-icon-first-aid-kit'
				}
			},
			{
				path: "editAccount",
				name: 'EditAccount',
				component: () => import('../views/editAccount'),
				hidden:true,
				meta: {
					title: '账号编辑',
					icon: 'el-icon-first-aid-kit'
				}
			}
		]
	},
	{
		path: '/login',
		name: 'Login',
		hidden: true,
		component: () => import('../views/login')
	}
]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
